package com.wlyuan.open.scanner.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author yuanjie
 * @since 2022-12-28
 */
@Data
@TableName("t_pay")
@ApiModel(value = "PayDO对象", description = "")
public class PayDO implements Serializable {


    private static final long serialVersionUID = -8899855605452588591L;
    private Integer type;

    private LocalDateTime createTime;

    /**
     * 代收
     */
    private Long down;

    private Long tenantId;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private LocalDateTime updateTime;

    /**
     * 代付
     */
    private Long up;

    public static PayDO create(Long up, Long down, Integer type, Long tenantId, LocalDateTime createTime) {
        PayDO payDO = new PayDO();
        payDO.up = up;
        payDO.down = down;
        payDO.type = type;
        payDO.tenantId = tenantId;
        payDO.createTime = createTime != null ? createTime : LocalDateTime.now();
        return payDO;
    }

}
